package com.cswangdao.service.impl;

import com.cswangdao.domain.vo.RoleValueLabelVo;
import com.cswangdao.mapper.MarketRoleMapper;
import com.cswangdao.result.PageResult;
import com.cswangdao.service.RoleService;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    private MarketRoleMapper roleMapper;

    @Override
    public PageResult<RoleValueLabelVo> options() {

        List<RoleValueLabelVo> options = roleMapper.options();
        PageResult<RoleValueLabelVo> pageResult = new PageResult<>();
        pageResult.setList(options);
        pageResult.setTotal((long)options.size());
        pageResult.setLimit(options.size());
        pageResult.setPage(1);
        pageResult.setPages(1);
        return pageResult;
    }


}
